package com.alex.game.framework
{
	import com.unsk.item.IUpdatable;
	
	import flash.display.DisplayObject;
	import flash.display.MovieClip;

	public class BasicState extends MovieClip
	{
		private var item_list:Array = new Array();
		
		public function create():void
		{
				
		}
		public function destroy():void
		{
			while(this.numChildren)
			{
				this.removeChildAt(0);
			}
		}
		public function update():void
		{
			for each(var item:IUpdatable in this.item_list)
			{
				item.update();
			}
		}
		public function add(obj:IUpdatable):void
		{
			obj.create();
			item_list.push(obj);
			this.addChild(DisplayObject(obj));
		}
	}
}